//============================================================================
// Name        : Feb20.cpp
// Author      : Anthony Varghese
// Version     : 1
// Copyright   : If you change this, add your name to the list of names for authors
// Description : Simple C++ class with operator overloading
//============================================================================

#include <iostream>
using namespace std;

class MyData{
public:
    MyData(){}
    MyData(int s){
        for (int i=0; i<10; i++)
            cloud[i] = s;
    }
    MyData(float array[10]){
        for (int i=0; i<10; i++)
            cloud[i] = array[i];
    }
    void print(){
        for (int i=0; i<10; i++)
            cout << cloud[i] << " ";
        cout << endl;
    }
    MyData operator +(MyData op){
        float result[10];
        for (int i=0; i<10; i++)
            result[i] = cloud[i] + op.cloud[i];
        return MyData( result );
    }
private:
    float cloud[ 10 ];
};


int main() {
    MyData x( 10 );

    float d[10] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
    MyData y( d );

    x.print();
    y.print();

    MyData z = x + y;

    z.print();
    return 0;
}
